package com.ruoyi.teach.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.teach.mapper.CrmCustomerReviewMapper;
import com.ruoyi.teach.domain.CrmCustomerReview;
import com.ruoyi.teach.service.ICrmCustomerReviewService;

/**
 * 客户回访记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-12-08
 */
@Service
public class CrmCustomerReviewServiceImpl implements ICrmCustomerReviewService 
{
    @Autowired
    private CrmCustomerReviewMapper crmCustomerReviewMapper;

    /**
     * 查询客户回访记录
     * 
     * @param reId 客户回访记录主键
     * @return 客户回访记录
     */
    @Override
    public CrmCustomerReview selectCrmCustomerReviewByReId(Long reId)
    {
        return crmCustomerReviewMapper.selectCrmCustomerReviewByReId(reId);
    }

    /**
     * 查询客户回访记录列表
     * 
     * @param crmCustomerReview 客户回访记录
     * @return 客户回访记录
     */
    @Override
    public List<CrmCustomerReview> selectCrmCustomerReviewList(CrmCustomerReview crmCustomerReview)
    {
        return crmCustomerReviewMapper.selectCrmCustomerReviewList(crmCustomerReview);
    }

    /**
     * 新增客户回访记录
     * 
     * @param crmCustomerReview 客户回访记录
     * @return 结果
     */
    @Override
    public int insertCrmCustomerReview(CrmCustomerReview crmCustomerReview)
    {
        crmCustomerReview.setCreateTime(DateUtils.getNowDate());
        return crmCustomerReviewMapper.insertCrmCustomerReview(crmCustomerReview);
    }

    /**
     * 修改客户回访记录
     * 
     * @param crmCustomerReview 客户回访记录
     * @return 结果
     */
    @Override
    public int updateCrmCustomerReview(CrmCustomerReview crmCustomerReview)
    {
        crmCustomerReview.setUpdateTime(DateUtils.getNowDate());
        return crmCustomerReviewMapper.updateCrmCustomerReview(crmCustomerReview);
    }

    /**
     * 批量删除客户回访记录
     * 
     * @param reIds 需要删除的客户回访记录主键
     * @return 结果
     */
    @Override
    public int deleteCrmCustomerReviewByReIds(Long[] reIds)
    {
        return crmCustomerReviewMapper.deleteCrmCustomerReviewByReIds(reIds);
    }

    /**
     * 删除客户回访记录信息
     * 
     * @param reId 客户回访记录主键
     * @return 结果
     */
    @Override
    public int deleteCrmCustomerReviewByReId(Long reId)
    {
        return crmCustomerReviewMapper.deleteCrmCustomerReviewByReId(reId);
    }
}
